//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package data_anno_dao

import "go.mongodb.org/mongo-driver/mongo"

var AnnoProjectDao *_AnnoProjectDao
var ResourceDao *_ResourceDao
var AnnoMemberDao *_AnnoMemberDao
var AnnoTaskDao *_AnnoTaskDao
var AnnoResultDao *_AnnoResultDao

func InitDao(mgoDb *mongo.Database) (err error) {
	AnnoProjectDao, err = newAnnoProjectDao(mgoDb)
	if err != nil {
		return err
	}
	ResourceDao, err = newResourceDao(mgoDb)
	if err != nil {
		return err
	}
	AnnoMemberDao, err = newAnnoMemberDao(mgoDb)
	if err != nil {
		return err
	}
	AnnoTaskDao, err = newAnnoTaskDao(mgoDb)
	if err != nil {
		return err
	}
	AnnoResultDao, err = newAnnoResultDao(mgoDb)
	if err != nil {
		return err
	}
	return nil
}
